package rentcar.repository.impl;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;
//import org.springframework.transaction.annotation.Transactional;

import rentcar.domain.Request;
import rentcar.repository.RequestDao;
import rentcar.repository.base.AbstractHibernateDao;


@Repository
public class RequestRepository extends AbstractHibernateDao<Request, Long> implements RequestDao {

	@Override
	public Request findById(Long requestId) {
		Criteria cr = getSession()
				.createCriteria(Request.class, "request")
				.add(Restrictions.eq("id", requestId));
		return (Request) cr.uniqueResult();
	}	
	
	
}
